package com.baitiaojun.moments.handler.canal.comment;

import com.baitiaojun.api.domain.video.VideoComment;
import com.baitiaojun.moments.handler.canal.SyncRedisHandler;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

/**
 * @类名 RedisUpdateViewCountSupport
 * @作者 白条君
 * @创建日期 2023/1/24 15:06
 * @版本 1.0
 */
@CanalTable("t_video_comment")
@Component
public class RedisUpdateVideoCommentHandler extends SyncRedisHandler implements EntryHandler<VideoComment> {

    @Override
    public void insert(VideoComment videoComment) {
        this.update(videoComment.getVideoId());
    }

    @Override
    public void delete(VideoComment videoComment) {
        this.update(videoComment.getVideoId());
    }
}